//
// Created by 原帅 on 2022/10/9.
//

#ifndef R_REE_H
#define R_REE_H

#include <map>
#include "ReeProcIF.h"

class Ree {

public:
    static Ree& Inst();

private:
    Ree();

    int reefd;

    std::map<int,std::map<ReeProcType,ReeProcIF*>> mapReeProcs;

    long timeoutSec = 0;
    long timeoutNSec = 0;

public:
    int addResponder(int fd, ReeProcType type, ReeProcIF *procIf);

    int processEvent();

    /**
     * 设置等待返回事件
     * @param msec 毫秒
     * @return succ:0, fail: -1
     */
    int setTimeoutMSec(long msec);
};


#endif //R_REE_H
